import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/task',
    children: [
      {
        path: '/task',
        name: 'TaskManage',
        component: () => import('../views/TaskManage.vue'),
        meta: { title: '任务管理' }
      },
      {
        path: '/log',
        name: 'LogManage',
        component: () => import('../views/LogManage.vue'),
        meta: { title: '下载日志' }
      },
      {
        path: '/entry',
        name: 'EntryData',
        component: () => import('../views/EntryData.vue'),
        meta: { title: '关单数据' }
      },
      {
        path: '/log-monitor',
        name: 'LogMonitor',
        component: () => import('../views/LogMonitor.vue'),
        meta: { title: '日志监控' }
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router

